Tegra: memctrl_v2: get chip revision using platform identifiers
authorVarun Wadekar <[email protected]>
Tue, 19 Jul 2016 00:43:41 +0000 (17:43 -0700)
committerVarun Wadekar <[email protected]>
Thu, 30 Mar 2017 23:49:05 +0000 (16:49 -0700)
This patch switches to the functions which identify the underlying
platform in order to calculate the chip SKU.

Change-Id: I20cf5623465289ccfab28d6578efcf762bfeb456
Signed-off-by: Varun Wadekar <[email protected]>
plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c

index 6f1d694756f1f7ca23abd39bafbdbbcfc05936e4..bd16b99167628c0a0424620f4c77c4c72bdb3a33 100644 (file)
@@ -38,6 +38,7 @@
 #include <smmu.h>
 #include <string.h>
 #include <tegra_def.h>
+#include <tegra_platform.h>
 #include <xlat_tables.h>
 
 #define TEGRA_GPU_RESET_REG_OFFSET     0x30
@@ -495,7 +496,6 @@ void tegra_memctrl_setup(void)
        uint32_t num_overrides = sizeof(streamid_overrides) / sizeof(uint32_t);
        uint32_t num_sec_cfgs = sizeof(sec_cfgs) / sizeof(mc_streamid_security_cfg_t);
        uint32_t num_txn_overrides = sizeof(mc_override_cfgs) / sizeof(mc_txn_override_cfg_t);
-       uint32_t chip_minor, chip_major;
        int i;
 
        INFO("Tegra Memory Controller (v2)\n");
@@ -543,12 +543,8 @@ void tegra_memctrl_setup(void)
        /*
         * Set the MC_TXN_OVERRIDE registers for write clients.
         */
-       chip_major = (mmio_read_32(TEGRA_MISC_BASE + HARDWARE_REVISION_OFFSET) >>
-                       MAJOR_VERSION_SHIFT) & MAJOR_VERSION_MASK;
-       chip_minor = (mmio_read_32(TEGRA_MISC_BASE + HARDWARE_REVISION_OFFSET) >>
-                       MINOR_VERSION_SHIFT) & MINOR_VERSION_MASK;
-
-       if ((chip_major == 0) || (chip_major > 0 && chip_minor == 1)) {
+       if (!tegra_platform_is_silicon() ||
+           (tegra_platform_is_silicon() && tegra_get_chipid_minor() == 1)) {
 
                /* GPU and NVENC settings for rev. A01 */
                val = tegra_mc_read_32(MC_TXN_OVERRIDE_CONFIG_GPUSWR);